package net.aiion.weave.reader;

import java.util.ArrayList;
import java.util.Collection;

public class Source
{
    private Collection<Event> events;
    private Context context;

    public Source() {
        context = new Context();

        events = new ArrayList<>();
        events.add(new Event("Hello"));
        events.add(new Event("World"));
        events.add(new Event("!"));
    }

    public void addSink(Sink aSink) {
        context.addSink(aSink);
    }

    public void readEvents() {
        for (Event e : events) {
            context.forwardEvent(e);
        }
    }
}
